<{include file="public_html/header.html"}>
<{include file="public_html/left_menu.html"}>
	<!-- content starts -->
	<blockquote class="layui-elem-quote"><{$action}></blockquote>

	<fieldset class="layui-elem-field">
  		<legend>按条件搜索</legend>
  		<div class="layui-field-box">
			<form class="layui-form layui-form-pane1" method="post" action="<{$current_url}>">
				<div class="layui-form-item">
			    	<div class="layui-inline">
			    		<input type="text" name="name" placeholder="代理商名称" value="<{if !empty($conditions['name'])}><{$conditions['name']}><{/if}>" class="layui-input">
			    	</div>
			    	<div class="layui-inline">
			    		<button type="submit" class="layui-btn">搜索</button>
			    		<a class="layui-btn" href="/agent/add"><i class="layui-icon"></i> 添加代理商</a>
			    	</div>
		    	</div>
			</form>
  		</div>
	</fieldset>
	<form class="layui-form layui-form-pane1" method="post" delete_action="/news/delete">
		<table class="layui-table" lay-even lay-skin="row">
		  	<thead>
			  	<tr>
				  	<th>代理商名称</th>
				  	<th>联系电话</th>
				  	<th>区域</th>
				  	<th>提成百分比</th>
				  	<th>创建时间</th>
				  	<th>操作</th>
			  	</tr>
		  	</thead>
		  	<tbody>
		  	<{foreach from=$agent_list item=item}>
			  	<tr>
			  		<td class="center"><{$item['name']}></td>
			  		<td class="center"><{$item['phone']}></td>
			  		<td class="center"><{$item['province_name']}> <{$item['city_name']}> <{$item['area_name']}></td>
			  		<td class="center"><{if $item['points'] > 0}><{$item['points']}>%<{/if}></td>
			  		<td class="center"><{$item['add_time']|date_format:'%Y-%m-%d %H:%M:%S'}></td>
			  		<td class="center">
			  			<a class="layui-btn layui-btn-primary layui-btn-small" href="/school/index/9/0/<{$item['id']}>">查看网校</a>
						<a class="layui-btn layui-btn-primary layui-btn-small" href="/agent/edit/<{$item['id']}>" target="_blank"><i class="layui-icon"></i></a>
						<a class="layui-btn layui-btn-primary layui-btn-small delete_data" href="/agent/delete/<{$item['id']}>"><i class="layui-icon"></i></a>
					</td>
			  	</tr>
		  	<{/foreach}>
		  	<{if $agent_list|count eq 0}>
		  		<tr>
			  		<td class="center" style=" height:120px; text-align:center;line-height:120px;" colspan="8">
						赞无数据！
					</td>
			  	</tr>
		  	<{/if}>
	  		</tbody>
	  	</table>
  	</form>
  	<div class="layui-box layui-laypage layui-laypage-default">
		<{$pagination}>
	</div>
<{include file="public_html/footer.html"}>
